<template>
  <div class="app-container">

    <el-form :model="queryParams" ref="queryRef" :inline="true" label-width="68px">
      <el-form-item label="日期" prop="monthYear">
        <el-date-picker size="small" v-model="queryParams.date" type="date" @change="bindSelectDate" placeholder="请选择" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
      </el-form-item>

    </el-form>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column label="序号" align="center" type="index" width="60" />
      <el-table-column prop="单位名称" label="单位名称"/>
      <el-table-column prop="收费站名称" label="收费站名称" />
      <el-table-column prop="路段名称" label="路段名称" />
      <el-table-column prop="拆除设施情况" label="拆除设施情况" />
      <el-table-column prop="日期" label="日期" />
      <el-table-column prop="是否从入口驶出" label="是否从入口驶出" />
      <el-table-column prop="是否属于违法车辆" label="是否属于违法车辆" />

      <el-table-column prop="是否正常通行" label="是否正常通行" />
      <el-table-column prop="是否移交" label="是否移交" />
      <el-table-column prop="超限运输车辆通行证号" label="超限运输车辆通行证号" />
    
      <el-table-column prop="通行时间" label="通行时间" />
      <el-table-column prop="驶入/驶出" label="驶入/驶出" />
    </el-table>

    <pagination v-show="total>0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
  </div>
</template>


<script setup>
import { ref } from 'vue';
import moment from 'moment'
import {  getTransportDetail } from "@/api/government/seeping";


const route = useRoute();
const { proxy } = getCurrentInstance()
const { sys_yes_no } = proxy.useDict("sys_yes_no");
const queryParams = ref({ "date": ''})

const loading = ref(false)
const tableData = ref([])
const total=ref([])

// 分类


/** 查询列表 */
function getList() {
  loading.value = true;
  getTransportDetail(queryParams.value).then(response => {
    tableData.value = response.data;
    total.value = response.total;
    loading.value = false;
  });
}



/** 搜索按钮操作 */
function handleQuery() {
  getList()
};
/** 重置按钮操作 */
function resetQuery() {
  queryParams.value = { "date": '' };
  proxy.resetForm("queryRef");
  init()
  handleQuery();
};


const bindSelectDate = (val) => {
  queryParams.value.date = moment(val).format('YYYY-MM-DD');
}
const init = () => {
  let startDate = moment().format("YYYY-MM-DD");
  queryParams.value.date = startDate;
}

init()
getList()
</script>

<style scoped>
.flex {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.flex .label {
  color: #333;
  font-size: 14px;
}

</style>